<!--#INCLUDE FILE="programmer.inc"-->
<!--#INCLUDE FILE="conn.asp"-->
<!-- #include file="function_charCode.asp" -->
<!-- #include file="function.asp" -->
<!--#include file="comSub.asp"-->
<script src=inc/js1.js></script>
<!-- #include file="UBB/myUBB.asp" -->

<!-- #include file="FriendOE.asp" -->

<%
call stylefile()
call tslt_username_error_Exit()
call bbsClose()

conn.execute("update ts_userinfo set newmessage=0 where username='"&session("tslt_username")&"'")

if (UserRoomSize() - UserAllSiteNoteSize(session("tslt_username"))) <= 0 then
    conn.execute("update ts_userinfo set RoomFull=true where username='"&session("tslt_username")&"'")
else
    conn.execute("update ts_userinfo set RoomFull=false where username='"&session("tslt_username")&"'")
end if

if Request("menu")="addreplypost" then
    call addreplypost(request("content1"),request("text1"))
end if
if Request("menu")="addsend" then
    call addsend(request("content2"),request("text2"))
end if
if Request("menu")="allsend" then
    call allsend(request("content3"))
end if
if Request("menu")="forummanageuser" then
    call forummanageuser(request("text4"),request("content4"),request("content44"))
end if

Function isblackName(aaa)
    isblackName=False
    dim sql,rs
    sql="select blackMenu from ts_userinfo where username='"&aaa&"'"
    set rs=conn.Execute(sql)
        if not rs.eof then
            dim blackMenu2
            blackMenu2 = rs("blackMenu")
            if blackMenu2<>"" then
                dim fff
                fff = Split(blackMenu2, "|")
                Dim i,blackName
                For i = UBound(fff) To 0 step-1
                    blackName=fff(i)  
                    if blackName=session("tslt_username") then 
                        if (session("tslt_useridentity")<>1 and session("tslt_useridentity")<>2 and session("tslt_useridentity")<>3) then
                            isblackName=True
                            Exit Function
                        end if
                    end if
                Next
            end if
        end if
    rs.close
    set rs=nothing
End Function

Function isblackIP(aaa)
    isblackIP=False
    dim sql,rs
    sql="select blackIP from ts_userinfo where username='"&aaa&"'"
    set rs=conn.Execute(sql)
        if not rs.eof then
            dim blackIP2
            blackIP2 = rs("blackIP")
            if blackIP2<>"" then
                dim fff
                fff = Split(blackIP2, "|")
                Dim i,BIP
                For i = UBound(fff) To 0 step-1
                    BIP=fff(i)  
                    if BIP=userIP() then
                        if (session("tslt_useridentity")<>1 and session("tslt_useridentity")<>2 and session("tslt_useridentity")<>3) then
                            isblackIP=True
                            Exit Function
                        end if
                    end if
                Next
            end if
        end if
    rs.close
    set rs=nothing
End Function

sub addreplypost(aaa,bbb) 
    if VCYes() then            
        Call ImgVCShow_handle()
    end if
    if isblackName(bbb)=True or isblackIP(bbb)=True then
        Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(0))</SCRIPT>"
        exit sub
    end if
    aaa=myReplace(aaa)
    aaa = UBBCode(aaa)
    dim rs,sql,replynewmessagenumb
    sql="select * from ts_userinfo where username='"&bbb&"'"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
        dim RoomFull2
        RoomFull2=rs("RoomFull")
        replynewmessagenumb=rs("newmessage")
        replynewmessagenumb=replynewmessagenumb+1
        conn.execute("update ts_userinfo set newmessage='"&replynewmessagenumb&"' where username='"&bbb&"' and RoomFull=false")
    RS.close
    Set RS = Nothing
    if RoomFull2<>true then
        dim Rs2
        Set Rs2=Server.CreateObject("ADODB.Recordset")
        Rs2.Open "sitenote", Conn, 1, 3
            Rs2.addnew array("author","incept","content","logintime","authorIP"),array(session("tslt_username"),bbb,aaa,now,userIP())
            Rs2.update
        Rs2.close
        Set Rs2 = Nothing
    end If
%>
    <script language="javascript">
            alert ("ظ <%=bbb%> ɹ  !");
            self.close();
    </script>
<%
    if VCYes() then  
	    Call ImgVCRndnum()
    end if
end sub

sub addsend(aaa,bbb)
    if VCYes() then            
        Call ImgVCShow_handle()
    end if
    if isblackName(bbb)=True or isblackIP(bbb)=True then
        Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(1))</SCRIPT>"
        exit sub
    end if
    aaa=myReplace(aaa)
    aaa = UBBCode(aaa)
    dim rs,sql
    sql="select * from ts_userinfo where username='"&bbb&"'"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
        if rs.bof or rs.eof then
%>
            <script language="javascript">
                    alert ("û <%=bbb%>   !");
                    self.close();
            </script>
<%
        else
            dim RoomFull2
            RoomFull2=rs("RoomFull")
            if RoomFull2<>true then
                dim newmessagenumb
                newmessagenumb=rs("newmessage")
                newmessagenumb=newmessagenumb+1
                conn.execute("update ts_userinfo set newmessage='"&newmessagenumb&"' where username='"&bbb&"'")
                Set Rs2=Server.CreateObject("ADODB.Recordset")
                Rs2.Open "sitenote", Conn, 1, 3
                    Rs2.addnew array("author","incept","content","logintime","authorIP"),array(session("tslt_username"),bbb,aaa,now,userIP())
                    Rs2.update
                Rs2.close
                Set Rs2 = Nothing
            end if
%>
            <script language="javascript">
                    alert ("ͶŸ <%=bbb%> ɹ  !");
                    self.close();
            </script>
<%
            if VCYes() then  
	             Call ImgVCRndnum()
            end if
        end if
    RS.close
    Set RS = Nothing
    dim rs3,sql3,userbcalss1
    sql3="select * from ts_userinfo where bclass=1 or bclass=2"
    set rs3=server.createobject("adodb.recordset")
    rs3.open sql3,conn,1,3
        do while not rs3.eof
           userbcalss1=rs3("username")
           if bbb=userbcalss1 then
              if rs3("autoreply")=true then
                 autoreplycontent2=rs3("autoreplycontent")
                 autoreplycontent2 = UBBCode(autoreplycontent2)
                 rs=conn.execute("select * from ts_userinfo where username='"&session("tslt_username")&"'")
                 if rs("RoomFull")<>true then
                    Set Rs4=Server.CreateObject("ADODB.Recordset")
                    Rs4.Open "sitenote", Conn, 1, 3
                        Rs4.addnew array("author","incept","content","logintime","authorIP"),array(userbcalss1,session("tslt_username"),autoreplycontent2,now,userIP())
                        Rs4.update
                    Rs4.close
                    Set Rs4 = Nothing
                 end if
              end if
           end if
           rs3.movenext
        loop
    rs3.close
    Set rs3 = Nothing
end sub

sub allsend(aaa)
    aaa=myReplace(aaa)
    aaa = UBBCode(aaa)
    dim rs,sql
    sql="select * from ts_userinfo"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
        if rs.bof or rs.eof then
            Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(2))</SCRIPT>"
        else
            dim allnewmessagenumb
            for j=0 to rs.recordcount
                allnewmessagenumb=rs("newmessage")
                conn.execute("update ts_userinfo set newmessage='"&allnewmessagenumb+1&"' where username='"&rs("username")&"' and RoomFull=false")
                RS.MoveNext
                If RS.EOF Then Exit For
            Next
            dim allsendrs,allsendsql
            allsendsql="select * from ts_userinfo where RoomFull=false"
            set allsendrs=server.createobject("adodb.recordset")
            allsendrs.open allsendsql,conn,1,3
                for i=0 to allsendrs.recordcount
                    username2=allsendrs("username")
                    dim allsendRs2
                    Set allsendRs2=Server.CreateObject("ADODB.Recordset")
                    allsendRS2.Open "sitenote", Conn, 1, 3
                        allsendrs2.addnew array("author","incept","content","logintime","authorIP"),array(session("tslt_username"),username2,aaa,now,userIP())
                        allsendrs2.update
                    allsendRs2.close              
                    set allsendRs2 = Nothing 
                    allsendRS.MoveNext
                    If allsendRS.EOF Then Exit For 
                Next
            allsendRS.close
            Set allsendRS = Nothing
        end if
    RS.close
    Set RS = Nothing
    Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(3))</SCRIPT>"
end sub

sub forummanageuser(aaa,bbb,ccc)
    if aaa="" then
        Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(4))</SCRIPT>"
        Response.end
    else
        bbb2=myReplace(bbb)
        bbb2 = UBBCode(bbb2)
        username=session("tslt_username")
        dim rs,newmessagenumb,sql
        sql="select * from ts_userinfo where username='"&aaa&"'"
        set rs=server.createobject("adodb.recordset")
        rs.open sql,conn,1,3
            newmessagenumb=rs("newmessage")
            newmessagenumb=newmessagenumb+1
            conn.execute("update ts_userinfo set newmessage='"&newmessagenumb&"' where username='"&aaa&"'")
        RS.close
        Set RS = Nothing
        dim Rs2
        Set Rs2=Server.CreateObject("ADODB.Recordset")
        Rs2.Open "sitenote", Conn, 1, 3
            Rs2.addnew array("author","incept","content","logintime","authorIP"),array(username,aaa,bbb2,now,userIP())
            Rs2.update
        Rs2.close
        Set Rs2 = Nothing
        If session("tslt_useridentity")=1 Or session("tslt_useridentity")=2 Then 
            if ccc<>"" then
                dim Rs3,sql3
                sql3="Select * From option1"
                Set Rs3=Server.CreateObject("ADODB.Recordset")
                Rs3.Open sql3, Conn, 1, 3
                    do while not Rs3.eof
                        conn.execute("update option1 set sitenotecotent='"&ccc&"'")
                        Rs3.movenext
                    loop
                Rs3.close
                Set Rs3 = Nothing
             end If
        End If 
%>
        <script language="javascript">
                alert ("ͶŸԱ <%=aaa%> ɹ  !");
                 self.close();
        </script>
<%
    end if
end sub
%>

<HTML>
<head>
<title>վڶ</title>

<SCRIPT language="JavaScript">
<!--
function set_dblclick() {
     var st = form2.friendlistname.options(form2.friendlistname.selectedIndex).text;
     var ret = confirm("ȷʵҪӺ޳ "+st+" ");
     if(ret!=false)
     {
             location.href="sitenotehandle.asp?communitytositenote=<%=request("communitytositenote")%>&communityid=<%=request.querystring("communityid")%>&boardtositenote=<%=request("boardtositenote")%>&boardid=<%=request.querystring("boardid")%>&menu=del&id=<%=objRS("id")%>&page=<%=request.querystring("page")%>&delfriendtext="+st;
      }
      else
      {
              return false;
      }
}

function set2_dblclick() {
     var st = form2.blackSel.options(form2.blackSel.selectedIndex).text;
     var ret = confirm("ȷʵҪӺͷ "+st+" ");
     if(ret!=false)
     {
             location.href="sitenotehandle.asp?communitytositenote=<%=request("communitytositenote")%>&communityid=<%=request.querystring("communityid")%>&boardtositenote=<%=request("boardtositenote")%>&boardid=<%=request.querystring("boardid")%>&menu=del&id=<%=objRS("id")%>&page=<%=request.querystring("page")%>&selT="+st;
      }
      else
      {
              return false;
      }
}

function set3_dblclick() {
     var st = form2.blackIPSel.options(form2.blackIPSel.selectedIndex).text;
     var ret = confirm("ȷʵҪӺIPͷ "+st+" ");
     if(ret!=false)
     {
             location.href="sitenotehandle.asp?communitytositenote=<%=request("communitytositenote")%>&communityid=<%=request.querystring("communityid")%>&boardtositenote=<%=request("boardtositenote")%>&boardid=<%=request.querystring("boardid")%>&menu=del&id=<%=objRS("id")%>&page=<%=request.querystring("page")%>&selIP="+st;
      }
      else
      {
              return false;
      }
}

function checkclick(src,q)
{
       var ret;
       ret = confirm(q);
       if(ret!=false)window.location=src;
}
-->     
</SCRIPT>

</HEAD>
<BODY topmargin=0>
<table border=0 width=100% cellspacing=0 cellpadding=1>
      <tr>
           <td width=100 height="67" bgcolor=greenyellow>
                 <img border="0" src="images/tushan2.gif" width="100" height="65" align=middle vspace=0 hspace=0>
           </td>
           <td rowspan=2 bgcolor=dodgerblue>
               <a href=advertisement/sitenotead/top.htm target="new">
               <%
                   set objad=server.createobject("mswc.adrotator")
                   response.write objad.getadvertisement("advertisement/sitenotead/topadrot.txt")
                   set objad=nothing
                %>
                </a>
           </td>
      </tr>
      <tr>
           <td height="6" bgcolor=dodgerblue>
           </td>
      </tr>
</table>
<table border=0 width=20% align=left cellspacing="1" cellpadding="1">
      <tr height=60>
           <td bgcolor=dodgerblue>
                 <!--     <img src=images2/ADs_1.gif alt= width=130 height=60>   -->
                 <a href=advertisement/sitenotead/left1.htm target="new">
                 <%
                    set objad=server.createobject("mswc.adrotator")
                    response.write objad.getadvertisement("advertisement/sitenotead/leftadrot1.txt")
                    set objad=nothing
                 %>
                 </a>
           </td>
      </tr>
      <tr height=10>
           <td></td>
      </tr>
      <tr height=60>
           <td bgcolor=dodgerblue>
                <a href=advertisement/sitenotead/left2.htm target="new">
                <%
                    set objad=server.createobject("mswc.adrotator")
                    response.write objad.getadvertisement("advertisement/sitenotead/leftadrot2.txt")
                    set objad=nothing
                %>
                </a>
           </td>     
      </tr>
      <tr height=10>
           <td></td>
      </tr>
      <tr height=60>
           <td bgcolor=dodgerblue>
                <a href=advertisement/sitenotead/left3.htm target="new">
                <%
                    set objad=server.createobject("mswc.adrotator")
                    response.write objad.getadvertisement("advertisement/sitenotead/leftadrot3.txt")
                    set objad=nothing
                 %>
                 </a>
           </td>
      </tr>
      <tr height=10>
           <td></td>
      </tr>
      <tr height=60>
           <td bgcolor=dodgerblue>
                <a href=advertisement/sitenotead/left4.htm target="new">
                <%
                    set objad=server.createobject("mswc.adrotator")
                    response.write objad.getadvertisement("advertisement/sitenotead/leftadrot4.txt")
                    set objad=nothing
                %>
                </a>
           </td>
      </tr>
</table>

<CENTER>
<table class=td8 border=0 width=79% cellspacing="0" cellpadding="6">
      <tr>
           <td align="left" class=font3 onmouseout="HideDivMenu2(2)">
                &nbsp;<img src=images/home.gif><a class=a4 onmouseover="Cmenu1.style.display='block'" href=index.asp>̳ҳ</a>
                <DIV onmouseover="Cmenu1.style.display='block'" onmouseout="Cmenu1.style.display='none'" style="display:none; position:absolute;" id="Cmenu1">
                      <%call CNavigation_BM()%>
                </DIV>
                <%if request.querystring("communitytositenote")="ok" then%>
                      <b></b>&nbsp;<a class=a4 onmouseover="Bmenu1.style.display='block'" href=community.asp?communityid=<%=request.querystring("communityid")%>><%=Communityname(request.querystring("communityid"))%></a>
                      <DIV onmouseover="Bmenu1.style.display='block'" onmouseout="Bmenu1.style.display='none'" style="display:none; position:absolute;" id="Bmenu1">
                            <%call BNavigation_BM(request.querystring("communityid"))%>
                      </DIV>
                <%elseif request.querystring("boardtositenote")="ok" then%>
                      <b></b>&nbsp;<a class=a4 onmouseover="Bmenu1.style.display='block'" href=community.asp?communityid=<%=Communityid_B_boardid(request.querystring("boardid"))%>><%=Communityname(Communityid_B_boardid(request.querystring("boardid")))%></a>
                      <DIV onmouseover="Bmenu1.style.display='block'" onmouseout="Bmenu1.style.display='none'" style="display:none; position:absolute;" id="Bmenu1">
                            <%call BNavigation_BM(Communityid_B_boardid(request.querystring("boardid")))         ' 鵼˵%>
                      </DIV>
                      <b></b>&nbsp;<a class=a4 href=board.asp?boardid=<%=request.querystring("boardid")%>><%=boardname(request.querystring("boardid"))%></a>
                <%end if%>
                <b></b>&nbsp;վڶ</font>
           </td>
           <td align=right class=font3>
                <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                      <A class=a4 href="admin_index/ad_index.asp"></A>
                <%end if%>
                <%if session("tslt_username")<>"" then%>
                      <%if session("tslt_openFrameChat")=True then%>
                            <A class=a2 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href='logout.asp';"><font color=red>ע¼</font></A>
                      <%else%>
                            <A class=a2 href="logout.asp"><font color=red>ע¼</font></A>
                      <%end if%>
                <%end if%>
                <A class=a4 id="TopRight_mune2" onmouseover="ShowDivMenu(2)">ܲ˵</A>
                <DIV id="div_mune2" align="right" style="display:none;" onmouseover="ShowDivMenu(2)" onmouseout="HideDivMenu(2)">
                      <table border="0" cellspacing="0" cellpadding="0" bordercolordark='#000000' bordercolorlight='#000000'>
                            <tr>
                                 <td height="4">
                                 </td >
                            <tr>
                                 <td class=font3>
			                         <img src="images/wyl.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 target="_blank" href="wyl/wy.asp">¼</A>
			                         <%If session("tslt_openFrameChat")="" then%>
					                       <img src="images/lts.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 href="index_Frame.asp?currentPU=<%=currentPageUrl%>"></A>
                                     <%else%>
					                       <img src="images/lts.gif" width="17" height="17" border=0 align=absmiddle><A class=a4 href="javascript:parent.bottomFrame.location.href='chat/exit.asp';parent.location.href=self.location.href;">ر</A>
                                     <%End if%>
			                      </td>
                            </tr>
                       </table>
                </DIV>
           </td>
      </tr>
</table>
<hr class=h1>

<%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
     <form name=form1 action=sitenotehandle.asp method=post>
     <table align=center width=79% border="0" cellspacing="1" cellpadding="0" >
          <tr><td>
                  <input type="hidden" name="isautoreply" value="ok">
                  <input type="hidden" name="communitytositenote" value=<%=request.querystring("communitytositenote")%>>
                  <input type="hidden" name="communityid" value=<%=request.querystring("communityid")%>>
                  <input type="hidden" name="boardtositenote" value=<%=request.querystring("boardtositenote")%>>
                  <input type="hidden" name="boardid" value=<%=request.querystring("boardid")%>>
                  <input type="hidden" name="page" value=<%=request.querystring("page")%>>
                  <%call autoreply(session("tslt_username"))%>
          <tr><td>
     </table>
     <hr>
     </form>
<%end if%>

<table class=border2 align=center width=750 border="0" cellspacing="5" cellpadding="0" >
      <tr>
           <td>
                <font color=#000070 face=Բ>
                վڶſռСΪ<%=UserRoomSize()%>K&nbsp;&nbsp;
                ʹã<%=UserAllSiteNoteSize(session("tslt_username"))%>K&nbsp;&nbsp;
                <font color=red>ʣ£
                <%if (UserRoomSize() - UserAllSiteNoteSize(session("tslt_username"))) < 0 then%>
                     0
                <%else%>
                      <%if (UserRoomSize() - UserAllSiteNoteSize(session("tslt_username")))>0 and (UserRoomSize() - UserAllSiteNoteSize(session("tslt_username")))<1 then%>
                            0<%=(UserRoomSize() - UserAllSiteNoteSize(session("tslt_username")))%>
                      <%else%>
                            <%=(UserRoomSize() - UserAllSiteNoteSize(session("tslt_username")))%>
                      <%end if%>
                <%end if%>K
                </font>
           </td>
      </tr>
      <tr>
           <td>
                <font color=#000070 face=Բ>
                עռٽܶţ뼴ʱɾҪϢ
                </font>
           </td>
       </tr>
       <tr>
           <td bgcolor=#dee7d6>
                <table border="0">
                     <tr bgcolor=#08246b>
                         <%if UserRoomSize()<>0 then%>
                              <%if int(UserAllSiteNoteSize(session("tslt_username"))/UserRoomSize()*750) > 750 then%>
                                          <td height=20 width=750>
                              <%else%>
                                          <td height=20 width=<%=int(UserAllSiteNoteSize(session("tslt_username"))/UserRoomSize()*750)%>>
                                    <%end if%>
                              <%end if%>
                      </tr>
                </table>
           </td>
       </tr>
</table>
<br>

<table align=center width=79% border="0" cellspacing="1" cellpadding="0" >
      <tr>
           <td> 
                <form name=form2 action=sitenotehandle.asp method=post>
                <table border="0" width=100%>
                      <tr>
                           <td> 
                                <input type="hidden" name="communitytositenote" value=<%=request.querystring("communitytositenote")%>>
                                <input type="hidden" name="communityid" value=<%=request.querystring("communityid")%>>
                                <input type="hidden" name="boardtositenote" value=<%=request.querystring("boardtositenote")%>>
                                <input type="hidden" name="boardid" value=<%=request.querystring("boardid")%>>
                                <input type="hidden" name="page" value=<%=request.querystring("page")%>>
                                <input type=text name=addfriendtext size=10 onmouseup="alert('ûûõߵļʱѶϢ⣩\nӺ˫û޳û');"><select name=friendlistname ondblclick="set_dblclick()" size=2 style="width:101px">
                                     <%call selfriend(session("tslt_username"))%>
                                </select><input class=input1 type=submit value= style="width:56px">

                                <input type=text name=blackText size=10 style="background-color:#D6D3CE" onmouseup="alert('ûûٽոûվڶţԱͰܴƣ\nӺ˫ûͷŸû');"><select name=blackSel size=2 ondblclick="set2_dblclick()" style="width:101px;background-color:#D6D3CE">
                                      <%call selBN(session("tslt_username"))%>
                                </select><input type=submit value= style="width:44px">

                                <input type=text name=blackIPText size=14 maxlength="30" style="background-color:#ADAAAD" onmouseup="alert('ûIPַIPַIPٽԸIPڵصվڶţԱͰܴƣ\nӺIP˫IPͷŸIP');"><select name=blackIPSel size=2 ondblclick="set3_dblclick()" style="width:130px;background-color:#ADAAAD">
                                      <%call selBIP(session("tslt_username"))%>
                                </select><input type=submit value=IP style="width:33px">

                                <br>
                                 <%if issitenoteNull()=True then%>
                                       <img src="images/clear2.gif" border=0>
                                 <%else%>
                                       <a href="javascript:checkclick('sitenotehandle.asp?communitytositenote=<%=request("communitytositenote")%>&communityid=<%=request.querystring("communityid")%>&boardtositenote=<%=request("boardtositenote")%>&boardid=<%=request.querystring("boardid")%>&menu=alldel','ȷҪȫ?')" title="ȫ"><img src="images/clear.gif" border=0></a>
                                 <%end if%>

                                 <a style=cursor:hand onclick=javascript:open('friend.asp?menu=send','','resizable=yes,width=320,height=220,top=200,left=240')><img alt='׫д' src=images/post_title3.gif width="40" height="40" border=0></a>
                                 <%if (session("tslt_useridentity")=1 or session("tslt_useridentity")=2) then%>
                                       <a style=cursor:hand onclick=javascript:open('friend.asp?menu=allsend','','resizable=yes,width=320,height=220,top=200,left=240')><img alt='Ⱥ' src=images/colony.BMP width="55" height="40" border=0></a>
                                 <%end if%>


                           </td>
                      </tr>
                </table>
                <table border="0" width=100%>
                      <tr>
                           <td> 
<%
                                Dim objRS,strSQL
                                strSQL = "SELECT * FROM sitenote where incept='"&session("tslt_username")&"' Order By id DESc"
                                Set objRS = Server.CreateObject("ADODB.Recordset")
                                objRS.Open strSQL, Conn, 1, 2
                                    If objRS.EOF And objRS.Bof Then 
                                       Response.Write "<SCRIPT language=Javascript>passwords(promptInfo_sitenote(5))</SCRIPT>"
					                End If 
                                    dim RowCount,totalPage,totalRecordcount
                                    if NOT objrs.EOF OR objrs.BOF then
                                        objrs.pagesize=showlistok()
                                        RowCount=objrs.PageSize
                                        totalPage=objrs.pagecount
                                        objRS.AbsolutePage=REQUEST("Page")
                                        totalRecordcount=objrs.recordcount
                                    end if
                                    DO WHILE NOT objrs.EOF AND RowCount>0
                                        Response.Write "<TR class=tdreply height='20'>"
                                        Response.Write "<td class=td5 width='25%'></font>&nbsp;"
                                        call userStanding(objRS("author"))
                                        call UserInfoLink(objRS("author"))
                                        Response.Write "</td>"
                                        Response.Write "<td class=td5><font color='brown'></font>&nbsp;&nbsp;"&objRS("logintime")&"</td>"
                                        Response.Write "<td class=td5><font color='brown'>IP</font>&nbsp;&nbsp;"&objRS("authorIP")&"</td>"
                                        Response.Write "<td class=td5 width='7%' align='right'><font color='brown'>:</font>"
                                        Response.Write "<td width='17%'>"
%>
                                        <a style=cursor:hand onclick=javascript:open('friend.asp?menu=replysend&incept=<%=objrs("author")%>','','resizable=no,width=320,height=220,top=200,left=240')><img alt='ظ' src=images/replynow.gif width='45' height='22' border=0></a>
                                        <a href="javascript:checkclick('sitenotehandle.asp?communitytositenote=<%=request("communitytositenote")%>&communityid=<%=request.querystring("communityid")%>&boardtositenote=<%=request("boardtositenote")%>&boardid=<%=request.querystring("boardid")%>&menu=del&id=<%=objRS("id")%>&page=<%=request.querystring("page")%>','ȷҪɾö?')" title="ɾö"><img src='images/del.gif' width='45' height='22' border=0></a></td>
<%
                                        Response.Write "</td>"
                                        Response.Write "</tr>"
                                        Response.Write "<tr bgcolor=#f7f6f6>"
                                        Response.Write "<td colspan='5' class=td6 align='left' height='15'><font color='brown'></font></td>"
                                        Response.Write "</TR>"
                                        Response.Write "<TR bgcolor=#f7f6f6>"
                                        Response.Write "<td colspan=5 style='word-break:break-all'>"&objRS("content")&"</td>"
                                        Response.Write "</TR>"
                                        Response.Write "<TR height='6' bgcolor='#fffff8'><td><td><td></TR>"
                                        RowCount = RowCount - 1
                                        objrs.MoveNext 
                                    Loop
                                objRS.close
                                Set objRS = Nothing
%>
                           </td>
                      </tr>
                </table>

                <br>
                <table border="0" align=center width=100% style="background-color:#D6D3CE">
                      <tr>
                           <td>
                                <%call pages()%>
                           </td>
                      </tr>
                </table>
                <br>

                </form>
           </td>
      </tr>
</table> 
</BODY>
</HTML>

<%
Call conn_Nothing()

sub autoreply(aaa)
    dim rs,sql,autoreply2,autoreplycontent2
    sql="select autoreply,autoreplycontent from ts_userinfo where username='"&aaa&"'"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
        do while not rs.eof
            autoreply2=rs("autoreply")
            autoreplycontent2=rs("autoreplycontent")
            rs.movenext
        loop
    rs.close
    Set rs = Nothing
%>
    <font size=2><b>ԱԶظֶ</b></font>:<textarea name=texta rows=2 cols=20><%=autoreplycontent2%></textarea>
    <input type=checkbox name=chk <%if autoreply2=true then%>checked<%end if%>>
    <input type=submit name=autoreplyname value=ȷ>
	<span style="font-size:12px"><a class=a1 href="UBB/UBBHtml.htm" target="_blank">֧UBB룩</span>
<%
end sub

sub selfriend(aaa)
    dim rs
    set rs=conn.execute("select friend from ts_userinfo where username='"&aaa&"'")
        if rs("friend")<>"" then
             do while not rs.eof
                dim self,self2
                self = rs("friend")
                self2 = Split(self, "|")
                Dim i
                For i = (UBound(self2)-1) To 1 step-1
                    response.write"<option>"&self2(i)&"</option>"
                Next
                rs.movenext
            loop
        end if
    rs.close
    set rs=nothing
end sub

sub selBN(aaa)
    dim rs
    set rs=conn.execute("select blackMenu from ts_userinfo where username='"&aaa&"'")
        if rs("blackMenu")<>"" then
            do while not rs.eof
                dim self,self2
                self = rs("blackMenu")
                self2 = Split(self, "|")
                Dim i
                For i = (UBound(self2)-1) To 1 step-1
                    response.write"<option>"&self2(i)&"</option>"
                Next
                rs.movenext
             loop
        end if
    rs.close
    set rs=nothing
end sub

sub selBIP(aaa)
    dim rs
    set rs=conn.execute("select blackIP from ts_userinfo where username='"&aaa&"'")
        if rs("blackIP")<>"" then
           do while not rs.eof
               dim self,self2
               self = rs("blackIP")
               self2 = Split(self, "|")
               Dim i
               For i = (UBound(self2)-1) To 1 step-1
                   response.write"<option>"&self2(i)&"</option>"
               Next
               rs.movenext
           loop
        end if
    rs.close
    set rs=nothing
end sub

Function UserAllSiteNoteSize(aaa)
    dim rs,Sql,ss
    ss = 0
    Set rs = Server.CreateObject("ADODB.Recordset")
    Sql = "Select content from sitenote where incept = '" &aaa&"'"
    rs.Open Sql,conn                   
        DO WHILE NOT rs.EOF                    
            ss = ss + Len(rs("content"))      
            rs.movenext    
        loop             
    rs.close
    set rs=nothing
    if ss<1024 and ss>0 then
         ss = ss/1024
         ss = 0 &left(ss,4)
    elseif ss = 0 then
         ss = 0
    else
         ss = ss\1024
    end if
    UserAllSiteNoteSize = ss
End Function

function UserRoomSize()
    dim UserRoomAddSize
    dim sss
    sss=SySAddSize()
    if sss=0 then sss=1
    UserRoomAddSize = (MYUserScore(session("tslt_username")) \ sss)
    if UserRoomAddSize<0 then UserRoomAddSize=0
    dim RS
    set RS=conn.execute("select DefaultMinSize,MaxSize from MYScoreRoom")
        dim DefaultMinSize2
        DefaultMinSize2 =RS("DefaultMinSize")
        dim MaxSize2
        MaxSize2 =RS("MaxSize")
    RS.close
    Set RS = Nothing
    dim RS2
    sql2="select AdhocRoomSize from ts_userinfo where username='" &session("tslt_username")& "'"
    set RS2=conn.execute(sql2)
        dim AdhocRoomSize2 
        AdhocRoomSize2 =RS2("AdhocRoomSize")
    RS2.close
    Set RS2 = Nothing
    if AdhocRoomSize2 <>0 then
        UserRoomAddSize = AdhocRoomSize2
    else
        UserRoomAddSize = UserRoomAddSize + DefaultMinSize2
        if UserRoomAddSize > MaxSize2 then UserRoomAddSize = MaxSize2
        conn.execute( "update ts_userinfo set RoomSize='" &UserRoomAddSize&"' where username = '" & session("tslt_username") &"'")
    end if
    UserRoomSize = UserRoomAddSize
end function

function MYUserScore(aaa)
    dim RS,spl
    sql="select UserIntegral from ts_userinfo where username='" &aaa& "'"
    set RS=conn.execute(sql)
        MYUserScore =RS("UserIntegral")
    RS.close
    Set RS = Nothing
end function

function SySAddSize()
    dim RS
    set rs=conn.execute("select AddSize from MYScoreRoom")
        SySAddSize =RS("AddSize")
    RS.close
    Set RS = Nothing
end function

Function ConversionSize(aaa)
    dim size,showsize
	size=aaa
	showsize=size & "<font color=#000000>KB"
	if size>1024 then
	    size=(size/1024)
	    showsize=formatnumber(size,2) & "<font color=red>MB"		
	end if
	if size>1024 then
	     size=(size/1024)
	     showsize=formatnumber(size,2) & "<font color=red>GB"	   
	end if   
    ConversionSize=showsize 
End Function 

Function issitenoteNull()
    issitenoteNull=False
    Dim RS,SQL
    SQL = "SELECT ID FROM sitenote where incept='"&session("tslt_username")&"'"
    Set RS = Server.CreateObject("ADODB.Recordset")
    RS.Open SQL, Conn
        If RS.EOF And RS.Bof Then 
            issitenoteNull=True
        End If
    RS.close
    Set RS = Nothing
End Function 

sub pages()
    dim boardid2,boardtositenote2
    boardid2=Request.QueryString("boardid")
    boardtositenote2=Request.QueryString("boardtositenote")
    dim communityid2,communitytositenote2
    communityid2=Request.QueryString("communityid")
    communitytositenote2=Request.QueryString("communitytositenote")
    dim Page      
    Page = Request("Page")
    if Page="" or Page=0 then
        page=1
    else
        page=cint(request("page"))
    end if
    if totalRecordcount<>0 then
        dim currid1,currid2
        if totalPage>=10 then
            if Page mod 10=0 then
                 currid1=Page
                 currid2=Page-9
             else
                 if totalPage mod 10=0 then 
                     currid1=int(Page/10)*10+10
                 else 
                     if int(Page/10)=int(totalPage/10) then currid1=(totalPage/10)*10 else currid1=int(Page/10)*10+10
                 end if
                 currid2=int(Page/10)*10+1
             end if
         else 
             currid1=totalPage mod 10
             currid2=int(totalPage/10)*10+1
         end if
%>
         <table align=left>
              <tr><td>
<%
                       if totalPage>1 Then
                              If Page=totalPage or Page<>1 Then 
                                  dim PrwePage
                                  PrwePage=Page-1
%>
							      <A class=a1 HREF="sitenote.asp?Page=<%=PrwePage%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>"><font size=4>һҳ</font></A>
<%
                              End If  
                        End If          
%>
               </td></tr>
         </table>
         <table border="0" align="left">
               <tr><td>
                       <FONT face=webdings size=2>
                       <%if Page=1 then%>
                               <span style="color: #FF0000">9</span>
                       <%else%>
                               <a class=a2 href="sitenote.asp?Page=1&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>">9</a>
                       <%end if%>
                       <%if Page>10 then%>
                               <a class=a2 href="sitenote.asp?Page=<%=currid2-1%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>">7</a>
                       <%end if%>
                       </FONT>
                       <strong>
<%
                       for i=currid2 to currid1
                            if Page=i then 
	                             response.Write("<font color=red size=4>"&i&"</font>  ")
                            else
%>
                                 <FONT size=2>
                                 <a class=a2 href="sitenote.asp?Page=<%=i%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>">
                                        <%response.write i%>
                                 </a>
                                 </FONT>
                            <%end if%>
                            <%response.write " "%>
                       <%next%>
                       </strong>
                       <FONT face=webdings size=2>
                       <%if currid1<totalPage then%>
                             <a class=a2 href="sitenote.asp?Page=<%=currid1+1%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>">8</a>
                      <%end if%>
                      </FONT> 
                      <FONT face=webdings size=2>
                      <%if Page=totalPage then%>
                             <span style="color: #FF0000">:</span>
                      <%else%>
                             <a class=a2 href="sitenote.asp?Page=<%=totalPage%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>">:</a>
                      <%end if%>
                      </FONT>
               </td></tr>
         </table>
         <table align=left>
               <tr><td>
<% 
                        if totalPage>1 Then
                            If page=1 or totalPage>Page Then
                                 dim NextPage
                                 NextPage=Page+1
%>
                                 <A class=a1 HREF="sitenote.asp?Page=<%=NextPage%>&boardid=<%=boardid2%>&boardtositenote=<%=boardtositenote2%>&communityid=<%=communityid2%>&communitytositenote=<%=communitytositenote2%>"><font size=4>һҳ</font></A>
<%
                             End If
                        End If
%>
                 </td></tr>
         </table>
         <table align=right>
                 <tr><td>
<%
                       if Page>totalPage then
                            Page=totalPage
                       end if
                      Response.Write "<font size=2>ҳΣ<font color= red><b>"& Page &"</b></font>/<b>"& totalPage &"</b>ҳ ,<b>"& totalRecordcount &"</b></font>"
                      Response.Write "&nbsp;&nbsp;&nbsp;&nbsp;"
   %>
                </td></tr>
         </table>
<%
    end if
end sub


%>